package cn.kgc.api.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.kgc.api.mapper.RolesMenusMapper;
import cn.kgc.api.entity.RolesMenus;
import cn.kgc.api.service.RolesMenusService;
import org.springframework.stereotype.Service;

import lombok.extern.slf4j.Slf4j;


@Slf4j
@Service("rolesMenusService")
public class RolesMenusServiceImpl extends ServiceImpl<RolesMenusMapper, RolesMenus> implements RolesMenusService {

    @Override
    public int count(int menuId) {
        // 创建LambdaQueryWrapper对象
        LambdaQueryWrapper<RolesMenus> queryWrapper=new LambdaQueryWrapper<>();
        // 设置查询条件，根据menuId查询
        queryWrapper.eq(RolesMenus::getMid,menuId);
        // 返回查询结果的数量
        return baseMapper.selectCount(queryWrapper);
    }

}
